// +----------------------------------------------------------------------
// | CRMEB [ CRMEB赋能开发者，助力企业发展 ]
// +----------------------------------------------------------------------
// | Copyright (c) 2016~2023 https://www.crmeb.com All rights reserved.
// +----------------------------------------------------------------------
// | Licensed CRMEB并不是自由软件，未经许可不能去掉CRMEB相关版权
// +----------------------------------------------------------------------
// | Author: CRMEB Team <admin@crmeb.com>
// +----------------------------------------------------------------------

import request from "@/utils/request.js";

/**
 * 获取用户信息
 * 
 */



export function promotion(data) {
	return request.post("promotion", data, {
		noAuth: true
	});
}
export function GetPromotionList(data) {
	return request.post("wx/Promotions/PromotionList", data, {
		noAuth: true
	});
}

export function PromotionUsersEntity(data) {
	return request.post("wx/Promotions/PromotionUsersEntity", data, {
		noAuth: true
	});
}
export function PromotionUserApply(data) {
	return request.post("wx/Promotions/PromotionUserApply", data, {
		noAuth: true
	});
}

export function CancelUserCoupon(data) {
	return request.post(
		`wx/Home/CancelUserCoupon?OpenId=${data.OpenId}&LuckyDrawCouponType=${data.LuckyDrawCouponType}&CouponCode=${data.CouponCode}`,
		data, {
			noAuth: true
		});
}

export function CreateOrderByMiniProgram(data) {
	return request.post('wx/pay/miniprogram', data, {
		noAuth: true
	})
}

export function GetDicData(data) {
	return request.get('wx/Promotions/GetBaseDataInfoList?Code=' + data.Code, {}, {
		noAuth: true
	});
}
export function GetQuestion(data) {
	return request.post('wx/PromotionsQuestion/GetList', data, {
		noAuth: true
	})
}

export function PromotionInsert(data) {
	return request.post('wx/Promotions/PromotionInsert', data, {
		noAuth: true
	})
}

export function LuckyDrawRedEnvelopeInsert(data) {
	return request.post('wx/Promotions/LuckyDrawRedEnvelopeInsert', data, {
		noAuth: true
	})
}

export function LuckyDrawCashCouponInsert(data) {
	return request.post('wx/Promotions/LuckyDrawCashCouponInsert', data, {
		noAuth: true
	})
}
export function LuckyDrawDiscountCouponInsert(data) {
	return request.post('wx/Promotions/LuckyDrawDiscountCouponInsert', data, {
		noAuth: true
	})
}
export function LuckyDrawGiftCouponInsert(data) {
	return request.post('wx/Promotions/LuckyDrawGiftCouponInsert', data, {
		noAuth: true
	})
}

export function GetPromotionUserAddressList(data) {
	return request.post(`wx/Promotions/GetPromotionUserAddressList?openId=${data.OpenId}`, data, {
		noAuth: true
	})
}

export function PromotionUserAddressInsert(data) {
	return request.post(`wx/Promotions/PromotionUserAddressInsert`, data, {
		noAuth: true
	})
}
export function PromotionUserAddressDel(data) {
	return request.post(`wx/Promotions/PromotionUserAddressDelete?id=${data.id}`, data, {
		noAuth: true
	})
}